<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<title>青年旅行家</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
	</head>

	<body>
		<div class="head" id="header">
			<a class="back" href="#" tapmode="" onclick="closeWin()"></a>
			<div class="head-text">
				注册：完善资料
			</div>
		</div>
		<div class="reg-wrap">
			<ul class="reg-form2">
        	<li class="reg-name"><i></i><input type="text" name="" placeholder="起个名字吧" id='userName' /></li>
        	<li class="reg-sex"><i></i><div class="radio">
        		<input type="radio" tapmode="" onclick="sex_click(0)"/><span>男</span>
        		<input type="radio" tapmode="" onclick="sex_click(1)"/><span>女</span>
        		<input type="radio" tapmode="" onclick="sex_click(2)" checked="checked"/><span>不好说</span>
        	</div></li>
        	<li class="reg-mail"><i></i><input type="text" name="" placeholder="邮箱" id='email'/></li>
        	<li class="reg-add"><i></i><input type="text" name="" placeholder="住址" id='adress'/></li>
        	<li class="reg-school"><i></i><input type="text" name="" placeholder="学校" id='school'/></li>
        </ul>
			<div class="reg-next">
				<a href="#" tapmode="" onclick="nextStep()">下一步</a>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/app.js"></script>
	<script type="text/javascript" src="../script/util.js"></script>
	<script type="text/javascript" src="../script/dot.min.js"></script>
	<script type="text/javascript" src="../script/zepto.min.js"></script>
	<script type="text/javascript">
		var sex=2;
		var uid='83';//$api.getStorage('uid')|'83';
		var pwd=$api.getStorage('pwd');
		function sex_click(s)
		{	
			var oArr=$('.radio input');			
			oArr[sex].checked=false;
			oArr[s].checked=true;
			sex=s;
		}
		function nextStep(){
			var uid=$api.getStorage('uid');			
			var url='/rest/user/updateUser?userId='+uid;
			var userName=$('#userName').val();
			var email=$('#email').val();
			var adress=$('#adress').val();
			var school=$('#school').val();			
			var data={};
			data.userName=userName;
			data.sex=sex;
			data.school=school;
			data.email=email;
			data.adress=adress;
			$api.setStorage('userData',data);
			openRegister3();
		}
		
		apiready = function() {
		var $header=$api.byId('header');
		$api.fixIos7Bar($header);
		}
		
	</script>

</html>